Implement data migration/import-export (#46) and advanced security/audit trail (#47)#55
Merged
Baskarayelu merged 1 commit intoRemitwise-Org:mainfrom Jan 30, 2026
Merged
Conversation
- Introduced a new `data_migration` module to handle data migration, including import/export utilities for Remitwise contracts. - Supported formats include JSON, binary, and CSV, with checksum validation and version compatibility checks. - Updated Cargo.toml to include the new module. - Added comprehensive tests for various scenarios, including negative coverage and premium cases, to ensure robust contract behavior.
Contributor
|
Looks good to me @Jagadeeshftw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #46 Data Migration and Import/Export Utilities and #47 Advanced Security Features and Audit Trail, and ensures CI passes (build, test, clippy, fmt).
#46 – Data Migration and Import/Export
New crate:
data_migrationSCHEMA_VERSIONandMIN_SUPPORTED_VERSION; version compatibility checked on import.export_to_json,export_to_binary,export_to_csv,export_to_encrypted_payload,import_from_json,import_from_binary,import_goals_from_csv,import_from_encrypted_payload,validate_for_import,check_version_compatibility.RollbackMetadatafor migration scripts.Contract changes
export_snapshot(env, caller),import_snapshot(env, caller, nonce, snapshot)with version and checksum validation (owner-only).export_snapshot(env, caller),import_snapshot(env, caller, nonce, snapshot)for full goals backup/restore with validation.#47 – Advanced Security and Audit Trail
remittance_split
AuditEntry(operation, caller, timestamp, success). All state-changing ops log success/failure;get_audit_log(env, from_index, limit)(capped at 100 entries).get_nonce(env, address); state-changing functions require correct nonce:initialize_split,update_split,distribute_usdc.calculate_splituseschecked_mul/checked_div/checked_sub.savings_goals
get_audit_log(env, from_index, limit).import_snapshotreplay protection;get_nonce(env, address).add_to_goaluseschecked_add,withdraw_from_goaluseschecked_sub.(Workspace already has
overflow-checks = truein release.)Breaking API changes
initialize_split(env, owner, nonce, spending_percent, ...)update_split(env, caller, nonce, ...)distribute_usdc(env, usdc_contract, from, nonce, accounts, total_amount)get_nonce) for these functions.Testing & CI
data_migration(checksum, JSON/binary/CSV export-import, version checks), remittance_splitexport_import_snapshot_and_auditandreplay_attack_rejected.cargo build --release --target wasm32-unknown-unknown,cargo test --all-features,cargo clippy --all-targets --all-features -- -D warnings,cargo fmt --all -- --checkall pass.Closes #46
Closes #47